﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Frame.Lib.Data;

namespace Cms.Entity.Article
{
    public partial class ArticleInfo : EntityBase
    {
        public override string GetTableName()
        {
            return "c_Article";
        }
        public override string GetInsertSql()
        {
            return "insert into c_Article ( [ID], [Name], [MenuID], [MenuName], [Source], [CreatorID], [CreatorName], [Summary], [Content], [InputTime], [UpdateTime], [KeyWords], [IsRecommend], [IsDisplay], [Orders], [ClickCount], [SmallImage], [BigImage]) values ( @ID, @Name, @MenuID, @MenuName, @Source, @CreatorID, @CreatorName, @Summary, @Content, @InputTime, @UpdateTime, @KeyWords, @IsRecommend, @IsDisplay, @Orders, @ClickCount, @SmallImage, @BigImage)";
        }
        public override string GetUpdateSql()
        {
            return "update c_Article set  [ID] = @ID, [Name] = @Name, [MenuID] = @MenuID, [MenuName] = @MenuName, [Source] = @Source, [CreatorID] = @CreatorID, [CreatorName] = @CreatorName, [Summary] = @Summary, [Content] = @Content, [InputTime] = @InputTime, [UpdateTime] = @UpdateTime, [KeyWords] = @KeyWords, [IsRecommend] = @IsRecommend, [IsDisplay] = @IsDisplay, [Orders] = @Orders, [ClickCount] = @ClickCount, [SmallImage] = @SmallImage, [BigImage] = @BigImage where ID = @ID";
        }
        /// <summary>
        /// 
        /// </summary>
        public Int32 ID
        {
            get;
            set;
        }
        /// <summary>
        /// 文章标题
        /// </summary>
        public String Name
        {
            get;
            set;
        }
        /// <summary>
        /// 
        /// </summary>
        public Int32 MenuID
        {
            get;
            set;
        }
        /// <summary>
        /// 
        /// </summary>
        public String MenuName
        {
            get;
            set;
        }
        /// <summary>
        /// 文章来源
        /// </summary>
        public String Source
        {
            get;
            set;
        }
        /// <summary>
        /// 发布人ID
        /// </summary>
        public Int32 CreatorID
        {
            get;
            set;
        }
        /// <summary>
        /// 发布人名字
        /// </summary>
        public String CreatorName
        {
            get;
            set;
        }
        /// <summary>
        /// 摘要
        /// </summary>
        public String Summary
        {
            get;
            set;
        }
        /// <summary>
        /// 内容
        /// </summary>
        public String Content
        {
            get;
            set;
        }
        /// <summary>
        /// 发布时间
        /// </summary>
        public DateTime InputTime
        {
            get;
            set;
        }
        /// <summary>
        /// 最后更改时间
        /// </summary>
        public DateTime UpdateTime
        {
            get;
            set;
        }
        /// <summary>
        /// 关键字，用于搜索用的
        /// </summary>
        public String KeyWords
        {
            get;
            set;
        }
        /// <summary>
        /// 是否推荐
        /// </summary>
        public Boolean IsRecommend
        {
            get;
            set;
        }
        /// <summary>
        /// 是否显示
        /// </summary>
        public Boolean IsDisplay
        {
            get;
            set;
        }
        /// <summary>
        /// 排序
        /// </summary>
        public Int32? Orders
        {
            get;
            set;
        }
        /// <summary>
        /// 点击次数
        /// </summary>
        public Int32 ClickCount
        {
            get;
            set;
        }
        /// <summary>
        /// 小图
        /// </summary>
        public String SmallImage
        {
            get;
            set;
        }
        /// <summary>
        /// 大图
        /// </summary>
        public String BigImage
        {
            get;
            set;
        }
        public override void SetValue(string key, object value)
        {
            key = key.ToLower();
            switch (key)
            {
                case "id":
                    this.ID = (Int32)value;
                    break;
                case "name":
                    this.Name = (String)value;
                    break;
                case "menuid":
                    this.MenuID = (Int32)value;
                    break;
                case "menuname":
                    this.MenuName = (String)value;
                    break;
                case "source":
                    this.Source = (String)value;
                    break;
                case "creatorid":
                    this.CreatorID = (Int32)value;
                    break;
                case "creatorname":
                    this.CreatorName = (String)value;
                    break;
                case "summary":
                    this.Summary = (String)value;
                    break;
                case "content":
                    this.Content = (String)value;
                    break;
                case "inputtime":
                    this.InputTime = (DateTime)value;
                    break;
                case "updatetime":
                    this.UpdateTime = (DateTime)value;
                    break;
                case "keywords":
                    this.KeyWords = (String)value;
                    break;
                case "isrecommend":
                    this.IsRecommend = (Boolean)value;
                    break;
                case "isdisplay":
                    this.IsDisplay = (Boolean)value;
                    break;
                case "orders":
                    this.Orders = (Int32?)value;
                    break;
                case "clickcount":
                    this.ClickCount = (Int32)value;
                    break;
                case "smallimage":
                    this.SmallImage = (String)value;
                    break;
                case "bigimage":
                    this.BigImage = (String)value;
                    break;
            }
        }
        public override object GetValue(string key)
        {
            key = key.ToLower();
            switch (key)
            {
                case "id":
                    return this.ID;
                case "name":
                    return this.Name;
                case "menuid":
                    return this.MenuID;
                case "menuname":
                    return this.MenuName;
                case "source":
                    return this.Source;
                case "creatorid":
                    return this.CreatorID;
                case "creatorname":
                    return this.CreatorName;
                case "summary":
                    return this.Summary;
                case "content":
                    return this.Content;
                case "inputtime":
                    return this.InputTime;
                case "updatetime":
                    return this.UpdateTime;
                case "keywords":
                    return this.KeyWords;
                case "isrecommend":
                    return this.IsRecommend;
                case "isdisplay":
                    return this.IsDisplay;
                case "orders":
                    return this.Orders;
                case "clickcount":
                    return this.ClickCount;
                case "smallimage":
                    return this.SmallImage;
                case "bigimage":
                    return this.BigImage;
                default:
                    return null;
            }
        }
    }


}
